﻿using System;

class PrintMatrixA
{
    static void Main()
    {
        //int[,] array = 
        //{
        //    { 1, 5, 9, 13 },
        //    { 2, 6, 10, 14 },
        //    { 3, 7, 11, 15 },
        //    { 1, 5, 9, 13 },
        //    { 4, 8, 12, 16 },
        //};

        int[,] array = new int[4, 4];

        Fill(array);
        Print(array);

    }

    static void Fill(int[,] array)
    {
        int counter = 1;
        for (int i = 0; i < array.GetLength(0); i++)
        {
            for (int j = 0; j < array.GetLength(1); j++)
            {
                array[j, i]=counter;
                counter++;
            }

        }
    }
    
    static void Print(int[,] array)
    {
        Console.WriteLine();
        for (int i = 0; i < array.GetLength(0); i++)
        {
            for (int j = 0; j < array.GetLength(1); j++)
            {
                Console.Write(" " + array[i, j]);
            }
            Console.WriteLine();
        }
    }
}